import logging
from gensim.models import word2vec


# 训练word2Vec模型

# 清理好的数据集路径
loadPath = ""
# 模型保持的路径
savePath = ""


def main():
    logging.basicConfig(format="%(asctime)s:%(levelname)s:%(message)s", level=logging.INFO)
    sent = word2vec.Text8Corpus(loadPath)  # 分词后的文件，词之间以空格隔开
    model = word2vec.Word2Vec(sent, size=300, window=5, iter=1, min_count=5)
    model.save(savePath)  # 模型保存路径


if __name__ == '__main__':
    main()
